package legumes.shared.domain;

import java.io.Serializable;

import javax.persistence.Id;


/**
 * @author smarty
 * Use to manage news products that are not referenced in our product list.
 * Must be validated by a human before begin set in the production datastore.
 */
public class NewProductMarket implements Serializable, Cloneable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id private long id = -1;
	private String comment = "";
	private Product product;
	/** Customer who creates this new product */
	private CustomerDTO customer;
	//Manage new product image
//	private Blob img;
	
	public long getId() {
		return id;
	}

	
	public void setId(long id_) {
		id = id_;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@Override
	public boolean equals(Object obj) {
		return getProduct().equals(((NewProductMarket) obj).getProduct());
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public CustomerDTO getCustomer() {
		return customer;
	}


	public void setCustomer(CustomerDTO customer) {
		this.customer = customer;
	}


	@Override
	public String toString() {
		return "[OnSaleProduct product=" + getProduct() + " customer=" + getCustomer().getEmail() + " comment="
				+ getComment() + "]";
	}

}
